package com.chanyachting.emall.action.businesstype;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.chanyachting.emall.domain.Businesstype;
import com.chanyachting.emall.service.BusinesstypeService;
import com.chanyachting.emall.serviceImpl.BusinesstypeServiceImpl;
import com.chanyachting.emall.util.RequestUtil;

public class DeleteAction extends Action {
	
	
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		int id=Integer.parseInt(new RequestUtil(request).getParameter("id", "0"));
		
		BusinesstypeService bs=new BusinesstypeServiceImpl();
		
		Businesstype by=new Businesstype();
		
		by.setId(id);
		by.setName("");
		by.setPri(0);
		
		bs.delBusinesstype(by);

		return mapping.findForward("businesstypeList");
	}
	

}
